package com.btl.component.domain;

import com.btl.boot.core.util.SpringContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ Description   :
 * @ Author        :  Frank Zhang
 * @ CreateDate    :  2020/11/09
 * @ Version       :  1.0
 */
@Configuration
@Slf4j
public class DomainAutoConfiguration implements InitializingBean {

    @Bean
    @ConditionalOnMissingBean(SpringContextHolder.class)
    public SpringContextHolder applicationContextHelper() {
        return new SpringContextHolder();
    }

    @Override
    public void afterPropertiesSet() {
        log.info("Component [domain] init");
    }
}
